﻿using commodity.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace commodity.Database
{
    public class CommodityDbContext: DbContext
    {
        public CommodityDbContext(DbContextOptions<CommodityDbContext> options) : base(options) { }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<SecondCommodityMenuCommodity>().HasKey(x => new { x.SecondCommodityMenuId, x.CommodityId });
            
        }
        public DbSet<FirstsCommodityMenu> FirstsCommodityMenus { get; set; }
        public DbSet<SecondCommodityMenu> SecondCommodityMenus { get; set; }
        public DbSet<Commodity> Commodities { get; set; }
        public DbSet<CommodityInformation> CommodityInformations { get; set; }
        public DbSet<Goods> goods { get; set; }
        public DbSet<GoodsPicture> goodsPictures { get; set; }
        public DbSet<GoodsInformation> goodsInformations { get; set; }
       
    }
}
